<?php if($this->pagination->total!=0&&$this->pagination->limit<$this->pagination->total): ?>
    <form name="pagination" method="post">
<ul id="pagination">        
        <?php if($this->pagination->pagecurrent==1): ?>
            <li class="previous-off">Start</li>
            <li class="previous-off">Rrev</li>
        <?php else: ?>
            <li class="previous"><a href="javascript:submitpagination(0)" >&laquo; Start</a></li>
            <li class="previous"><a href="javascript:submitpagination(<?php echo(($this->pagination->pagecurrent-2)*$this->pagination->limit) ?>)">Rrev</a></li>
        <?php endif ?>
        
        <?php for($i=1;$i<=$this->pagination->pagetotal;$i++): ?>
            <?php if($i==$this->pagination->pagecurrent): ?>
                <li class="active"><?php echo $i ?></li>
                 <?php elseif(3>=$i||$i>=$this->pagination->pagetotal-3): ?>
                <li><a href="javascript:submitpagination(<?php echo(($i-1)*$this->pagination->limit) ?>)"><?php echo $i ?></a></li>
            <?php elseif($this->pagination->pagecurrent-2<=$i&&$i<=$this->pagination->pagecurrent+2): ?>
                <li><a href="javascript:submitpagination(<?php echo(($i-1)*$this->pagination->limit) ?>)"><?php echo $i ?></a></li>
            <?php endif; ?>
        <?php endfor; ?>
        
        <?php if($this->pagination->pagecurrent==$this->pagination->pagetotal): ?>
            <li class="next-off">Next</li>
            <li class="next-off">End</li>
        <?php else: ?>
            <li class="next"><a href="javascript:submitpagination(<?php echo(($this->pagination->pagecurrent)*$this->pagination->limit) ?>)" >Next</a></li>
            <li class="next"><a href="javascript:submitpagination(<?php echo(($this->pagination->pagetotal-1)*$this->pagination->limit) ?>)" >End &raquo;</a></li>
        <?php endif ?>
</ul>                
        <input type="hidden" name="limitstart" />
        <input type="hidden" name="firts" value="1" />
    </form>
    <script language="javascript">
       function submitpagination(limitstart)
    {
        document.pagination.limitstart.value=limitstart;
        document.pagination.submit();   
    }
    </script>
<?php endif; ?>
